const fontMin = require('fontmin')
const fs = require('fs')

const text = fs.readFileSync('text.txt', 'utf-8')
console.log(text)

const min = new fontMin()
  .src('fonts/*.ttf')
  .use(
    fontMin.glyph({
      text,
    }),
  )
  .dest('output')
min.run((error, files, stream) => {
  if (error) {
    console.log(`😢 提取字体出错：${error}`)
  }
  console.log('🍺 提取完成！')
})
